<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddMenuTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menu', function(Blueprint $table){
            $table->increments('id');
            $table->enum('type', ['click', 'view'])->comment('菜单类型');
            $table->string('key')->comment('点击事件对应的KEY');
            $table->string('url')->comment('VIEW事件对应的链接');
            $table->string('name')->comment('菜单名');
            $table->integer('parent_id')->default(null)->comment('父菜单ID');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('menu');
    }
}
